﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PropertyTax
{
    class Program
    {
        static void Main(string[] args)
        {
            /* Pseudocode for this program:
             * Input totalPropertyValue
             * assesment = 60% of propertyValue
             * propertyTax = assesment / 100 * 64 cents
             * display propertyTax of assesment from totalPropertyValue
             * End program or loop
             */
            string loop = "Y";
            double propertyTax = 0, totalPropertyValue = 0, assessment =0;
            while (loop.ToUpper() == "Y")
            {
                getPropertyValue(ref totalPropertyValue);
                getAssesmentValue(ref assessment, totalPropertyValue);
                getPropertyTax(ref propertyTax, assessment);
                Console.WriteLine("Property tax to be paid is ${0} from an assessment value of ${1} (60%) of the total property value of ${2}", propertyTax,assessment,totalPropertyValue);
                print("Type Y to calculate aother property or any other key to end the program");
                loop = Console.ReadLine();
            }

        }
        static void getPropertyValue(ref double totalPropertyValue)
        {
            print("Please provide the total value of your property to provide you with the tax ammount");
            while (!double.TryParse(Console.ReadLine(), out totalPropertyValue))
            {
                print("The total value you have provided is not valid");
            }
            print("Thank you, i will now calculate the tax ammount");
        }
        static void getAssesmentValue(ref double assessment, double totalPropertyValue)
        {
            assessment = totalPropertyValue * .60;
        }
        static void getPropertyTax(ref double propertyTax, double assessment)
        {
            propertyTax = assessment / 100 * .64;
        }
        static void print(string text)
        {
            Console.WriteLine("\n{0}",text);
        }
    }
}
